<template>
  <div class="left-panel">
    <div
        v-for="(item, index) in svgItems"
        :key="index"
        class="draggable-item"
        draggable="true"
        @dragstart="onDragStart($event, item)"
    >
      {{ item.name }}
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      svgItems: [
        { name: 'Circle', type: 'circle' },
        { name: 'Rectangle', type: 'rect' },
        { name: 'Line', type: 'line' },
      ],
    };
  },
  methods: {
    onDragStart(event, item) {
      event.dataTransfer.setData('text/plain', JSON.stringify(item));
    },
  },
};
</script>

<style scoped>
.left-panel {
  width: 200px;
  height: 100vh;
  border-right: 1px solid #ccc;
  padding: 10px;
}

.draggable-item {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  cursor: grab;
}
</style>
